﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleAppDemo.ArithmeticSore
{
    public class BubbleSore
    {
        public static void Entry()
        {
            var arr=new int[]{1,2,9,4,3,2,8,0};
            Bubble(arr);
            for (int i = 0; i < arr.Count(); i++)
            {
                Console.WriteLine(arr[i]);
            }
        }
        public static void Bubble(int[] arr)
        {
            for (int i = 0; i < arr.Count(); i++)
            {
                for (int j = 0; j < arr.Count() - i - 1; j++)
                {
                    if (arr[j] <= arr[j + 1])
                    {
                        int temp = arr[j];
                        arr[j] = arr[j + 1];
                        arr[j + 1] = temp;
                    }
                }
            }
        }
    }
}
